package cn.assumejson.springframework.beans.context;

/**
 * 事件发布接口
 *
 * @author Mr. Li
 * @version 1.0
 * @since 1.0 2021/12/2 0:24
 */
@FunctionalInterface
public interface ApplicationEventPublisher {


    /**
     * Notify all <strong>matching</strong> listeners registered with this
     * application of an application event. Events may be framework events
     * (such as RequestHandledEvent) or application-specific events.
     *
     * @param event the event to publish
     */
    default void publishEvent(ApplicationEvent event) {
        publishEvent((Object) event);
    }

    /**
     * 发布事件
     *
     * @param event 事件
     */
    void publishEvent(Object event);
}
